/**
 * @typedef {ImageShapeOptions&{
 * borderWidth?:number;
 * }} BorderImageShapeOptions
 */
class BorderImageShape extends ImageShape {
  /**
   * @description 边框宽度
   * @type {number}
   */
  borderWidth = 4;

  /**
   * @type {boolean}
   */
  border = false;

  /**
   * @description 构造函数
   * @param {BorderImageShapeOptions} options
   */
  constructor(options) {
    super(options);
  }

  draw() {
    if (this.border) {
      this.ctx.lineWidth = this.borderWidth;
      this.ctx.strokeStyle = "blue";
      this.ctx.strokeRect(this.x, this.y, this.width, this.height);
    }
    this.ctx.drawImage(this.img, this.x, this.y, this.width, this.height);
  }
}
